using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._GeostatisticalAnalystTools._Interpolation
{
    /// <summary>
    /// <para>Kernel Interpolation With Barriers</para>
    /// <para>A moving window predictor that uses the shortest distance between points so that points on either side of the line barriers are connected.</para>
    /// <para>一个移动窗口预测器，它使用点之间的最短距离，以便连接线障碍两侧的点。</para>
    /// </summary>    
    [DisplayName("Kernel Interpolation With Barriers")]
    public class KernelInterpolationWithBarriers : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public KernelInterpolationWithBarriers()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input features</para>
        /// <para>The input point features containing the z-values to be interpolated.</para>
        /// <para>包含要插值的 z 值的输入点要素。</para>
        /// </param>
        /// <param name="_z_field">
        /// <para>Z value field</para>
        /// <para>Field that holds a height or magnitude value for each point. This can be a numeric field or the Shape field if the input features contain z-values or m-values.</para>
        /// <para>保存每个点的高度或大小值的字段。这可以是数值字段，也可以是形状字段（如果输入要素包含 z 值或 m 值）。</para>
        /// </param>
        public KernelInterpolationWithBarriers(object _in_features, object _z_field)
        {
            this._in_features = _in_features;
            this._z_field = _z_field;
        }
        public override string ToolboxName => "Geostatistical Analyst Tools";

        public override string ToolName => "Kernel Interpolation With Barriers";

        public override string CallName => "ga.KernelInterpolationWithBarriers";

        public override List<string> AcceptEnvironments => ["cellSize", "coincidentPoints", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "parallelProcessingFactor", "snapRaster", "workspace"];

        public override object[] ParameterInfo => [_in_features, _z_field, _out_ga_layer, _out_raster, _cell_size, _in_barrier_features, _kernel_function.GetGPValue(), _bandwidth, _power, _ridge, _output_type.GetGPValue()];

        /// <summary>
        /// <para>Input features</para>
        /// <para>The input point features containing the z-values to be interpolated.</para>
        /// <para>包含要插值的 z 值的输入点要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Z value field</para>
        /// <para>Field that holds a height or magnitude value for each point. This can be a numeric field or the Shape field if the input features contain z-values or m-values.</para>
        /// <para>保存每个点的高度或大小值的字段。这可以是数值字段，也可以是形状字段（如果输入要素包含 z 值或 m 值）。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Z value field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _z_field { get; set; }


        /// <summary>
        /// <para>Output geostatistical layer</para>
        /// <para>The geostatistical layer produced. This layer is required output only if no output raster is requested.</para>
        /// <para>生成的地统计图层。仅当未请求输出栅格时，此图层才是必需的输出。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output geostatistical layer")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_ga_layer { get; set; } = null;


        /// <summary>
        /// <para>Output raster</para>
        /// <para>The output raster. This raster is required output only if no output geostatistical layer is requested.</para>
        /// <para>输出栅格。仅当未请求输出地统计图层时，此栅格才是必需的输出。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_raster { get; set; } = null;


        /// <summary>
        /// <para>Output cell size</para>
        /// <para><xdoc>
        ///   <para>The cell size at which the output raster will be created.</para>
        ///   <para>This value can be explicitly set in the Environments by the Cell Size parameter.</para>
        ///   <para>If not set, it is the shorter of the width or the height of the extent of the input point features, in the input spatial reference, divided by 250.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将创建输出栅格的像元大小。</para>
        ///   <para>此值可以通过像元大小参数在“环境”中显式设置。</para>
        ///   <para>如果未设置，则为输入空间参考中输入点要素范围的宽度或高度除以 250 的较短者。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output cell size")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _cell_size { get; set; } = null;


        /// <summary>
        /// <para>Input absolute barrier features</para>
        /// <para>Absolute barrier features using non-Euclidean distances rather than line-of-sight distances.</para>
        /// <para>使用非欧几里得距离而不是视线距离的绝对屏障要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input absolute barrier features")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_barrier_features { get; set; } = null;


        /// <summary>
        /// <para>Kernel function</para>
        /// <para><xdoc>
        ///   <para>The kernel function used in the simulation.</para>
        ///   <bulletList>
        ///     <bullet_item>Exponential— The function grows or decays proportionally.</bullet_item><para/>
        ///     <bullet_item>Gaussian— Bell-shaped function that falls off quickly toward plus/minus infinity.</bullet_item><para/>
        ///     <bullet_item>Quartic— Fourth-order polynomial function.</bullet_item><para/>
        ///     <bullet_item>Epanechnikov— A discontinuous parabolic function.</bullet_item><para/>
        ///     <bullet_item>Fifth order polynomial— Fifth-order polynomial function.</bullet_item><para/>
        ///     <bullet_item>Constant—An indicator function.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>仿真中使用的内核函数。</para>
        ///   <bulletList>
        ///     <bullet_item>指数 — 函数按比例增长或衰减。</bullet_item><para/>
        ///     <bullet_item>高斯 — 钟形函数，快速下降到正/负无穷大。</bullet_item><para/>
        ///     <bullet_item>Quartic— 四阶多项式函数。</bullet_item><para/>
        ///     <bullet_item>Epanechnikov— 不连续抛物线函数。</bullet_item><para/>
        ///     <bullet_item>五阶多项式— 五阶多项式函数。</bullet_item><para/>
        ///     <bullet_item>常量 - 指标函数。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Kernel function")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _kernel_function_value _kernel_function { get; set; } = _kernel_function_value._POLYNOMIAL5;

        public enum _kernel_function_value
        {
            /// <summary>
            /// <para>Exponential</para>
            /// <para>Exponential— The function grows or decays proportionally.</para>
            /// <para>指数 — 函数按比例增长或衰减。</para>
            /// </summary>
            [Description("Exponential")]
            [GPEnumValue("EXPONENTIAL")]
            _EXPONENTIAL,

            /// <summary>
            /// <para>Gaussian</para>
            /// <para>Gaussian— Bell-shaped function that falls off quickly toward plus/minus infinity.</para>
            /// <para>高斯 — 钟形函数，快速下降到正/负无穷大。</para>
            /// </summary>
            [Description("Gaussian")]
            [GPEnumValue("GAUSSIAN")]
            _GAUSSIAN,

            /// <summary>
            /// <para>Quartic</para>
            /// <para>Quartic— Fourth-order polynomial function.</para>
            /// <para>Quartic— 四阶多项式函数。</para>
            /// </summary>
            [Description("Quartic")]
            [GPEnumValue("QUARTIC")]
            _QUARTIC,

            /// <summary>
            /// <para>Epanechnikov</para>
            /// <para>Epanechnikov— A discontinuous parabolic function.</para>
            /// <para>Epanechnikov— 不连续抛物线函数。</para>
            /// </summary>
            [Description("Epanechnikov")]
            [GPEnumValue("EPANECHNIKOV")]
            _EPANECHNIKOV,

            /// <summary>
            /// <para>Fifth order polynomial</para>
            /// <para>Fifth order polynomial— Fifth-order polynomial function.</para>
            /// <para>五阶多项式— 五阶多项式函数。</para>
            /// </summary>
            [Description("Fifth order polynomial")]
            [GPEnumValue("POLYNOMIAL5")]
            _POLYNOMIAL5,

            /// <summary>
            /// <para>Constant</para>
            /// <para>Constant—An indicator function.</para>
            /// <para>常量 - 指标函数。</para>
            /// </summary>
            [Description("Constant")]
            [GPEnumValue("CONSTANT")]
            _CONSTANT,

        }

        /// <summary>
        /// <para>Bandwidth</para>
        /// <para>Used to specify the maximum distance at which data points are used for prediction. With increasing bandwidth, prediction bias increases and prediction variance decreases.</para>
        /// <para>用于指定数据点用于预测的最大距离。随着带宽的增加，预测偏差增加，预测方差减小。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Bandwidth")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _bandwidth { get; set; } = null;


        /// <summary>
        /// <para>Order of polynomial</para>
        /// <para>Sets the order of the polynomial.</para>
        /// <para>设置多项式的顺序。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Order of polynomial")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _power { get; set; } = 1;


        /// <summary>
        /// <para>Ridge parameter</para>
        /// <para>Used for the numerical stabilization of the solution of the system of linear equations. It does not influence predictions in the case of regularly distributed data without barriers. Predictions for areas in which the data is located near the feature barrier or isolated by the barriers can be unstable and tend to require relatively large ridge parameter values.</para>
        /// <para>用于线性方程组解的数值稳定。在无障碍地定期分发数据的情况下，它不会影响预测。对于数据位于要素障碍附近或被障碍隔离的区域，预测可能不稳定，并且往往需要相对较大的岭参数值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Ridge parameter")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _ridge { get; set; } = 50;


        /// <summary>
        /// <para>Output surface type</para>
        /// <para><xdoc>
        ///   <para>Surface type to store the interpolation results.</para>
        ///   <bulletList>
        ///     <bullet_item>Prediction—Prediction surfaces are produced from the interpolated values.</bullet_item><para/>
        ///     <bullet_item>Standard error of prediction— Standard Error surfaces are produced from the standard errors of the interpolated values.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于存储插值结果的曲面类型。</para>
        ///   <bulletList>
        ///     <bullet_item>预测 - 根据插值生成预测曲面。</bullet_item><para/>
        ///     <bullet_item>预测标准误差 - 标准误差曲面由插值的标准误差生成。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output surface type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _output_type_value _output_type { get; set; } = _output_type_value._PREDICTION;

        public enum _output_type_value
        {
            /// <summary>
            /// <para>Prediction</para>
            /// <para>Prediction—Prediction surfaces are produced from the interpolated values.</para>
            /// <para>预测 - 根据插值生成预测曲面。</para>
            /// </summary>
            [Description("Prediction")]
            [GPEnumValue("PREDICTION")]
            _PREDICTION,

            /// <summary>
            /// <para>Standard error of prediction</para>
            /// <para>Standard error of prediction— Standard Error surfaces are produced from the standard errors of the interpolated values.</para>
            /// <para>预测标准误差 - 标准误差曲面由插值的标准误差生成。</para>
            /// </summary>
            [Description("Standard error of prediction")]
            [GPEnumValue("PREDICTION_STANDARD_ERROR")]
            _PREDICTION_STANDARD_ERROR,

        }

        public KernelInterpolationWithBarriers SetEnv(object cellSize = null, object coincidentPoints = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object parallelProcessingFactor = null, object snapRaster = null, object workspace = null)
        {
            base.SetEnv(cellSize: cellSize, coincidentPoints: coincidentPoints, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, snapRaster: snapRaster, workspace: workspace);
            return this;
        }

    }

}